﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace OneBarCode
{
    public partial class FrmPrintNum : Form
    {
        public FrmPrintNum()
        {
            InitializeComponent();
        }
        public static long longstart;
        public static long longend;
        public static DateTime pruductionDate;
        private long start = 0;
        private long end = 0;
        public long getStart() { return start; }
        public long getEnd() { return end; }
        private void btnCancel_Click(object sender, EventArgs e)
        {
            longstart = 0;
            longend = 0;
            this.Close();
        }

        private void btnOk_Click(object sender, EventArgs e)
        {
            longstart = 0;
            longend = 0;
            if (string.IsNullOrEmpty(txtStart.Text) || string.IsNullOrEmpty(txtEnd.Text))
            {
                MessageBox.Show("请正确设置参数");
                return;
            }
            //long start=0;
            //long end=0;
            if (long.TryParse(txtStart.Text, out start) && long.TryParse(txtEnd.Text, out end))
            {
                if (start>end)
                {
                    MessageBox.Show("请正确设置参数");
                    return;
                }
                else
                {
                    longstart = start;
                    longend = end;
                    pruductionDate = dateTimePicker1.Value;
                    //this.Hide();
                    this.Close();
                }
            }
            else
            {
                MessageBox.Show("请正确设置参数");
                return;
            }
        }
    }
}
